package com.pattern.observer;

public class ObserverTest {

    public static void main(String[] args) {
        Author authorObserver = new Author();
        iKunObserver iKunObserver = new iKunObserver();
        QiangObserver qiangObserver = new QiangObserver();
        //粉丝关注
        authorObserver.addObserver(iKunObserver);
        authorObserver.addObserver(qiangObserver);

        //作者发消息
        authorObserver.sendMessage("今日福利——JK制服特辑");

        System.out.println("光头强取消了关注后----------------------------------");
        //光头强取消了关注
        authorObserver.removeObserver(qiangObserver);
        authorObserver.sendMessage("今日福利——黑丝特辑");
    }

}
